﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>Index</title>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/ChkInfoOrder.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    @Html.DevExpress().GetScripts(
                    new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script type="text/javascript">
        $(function () {
            $('#tbDocInfoOrder').html($('#hidDocInfoOrder').val());
            iframeAutoFit();
        })

//        function MenuTop_emClick(source, e) {
//            switch (e.item.name) {
//                case "btnExport":
//                    {
//                        //导出excel
//                        ExportToExcel();
//                        break;
//                    }
//            }
//        }

        function ExportToExcel() {
            var objFYear = ASPxClientComboBox.Cast("FYear");
            var objFQuarter = ASPxClientComboBox.Cast("FQuarter");
            var year = objFYear.GetValue();
            var quarter =objFQuarter.GetValue();

            $('#hidFYear').val(year);
            $('#hidFQuarter').val(quarter);
            form1.submit();
        }

        //查询
        function search() {
            var objFYear = ASPxClientComboBox.Cast("FYear");
            var objFQuarter = ASPxClientComboBox.Cast("FQuarter");
            var year = escape(objFYear.GetValue());
            var quarter = escape(objFQuarter.GetValue());
            if (year != null && quarter != null) {
                window.location.href = rootPath + "/Admin/DocInfoOrder?year=" + year + "&quarter=" + quarter;
            }
        }
        function iframeAutoFit() {
            var ex;
            try {
                if (window != parent) {
                    var a = parent.document.getElementsByTagName("IFRAME");
                    for (var i = 0; i < a.length; i++) {
                        //window.name != "contentframe"后台页面iframe名称
                        if (a[i].contentWindow == window && window.name != "contentframe") {
                            var h1 = 0, h2 = 0;
                            if (document.documentElement && document.documentElement.scrollHeight) {
                                h1 = document.documentElement.scrollHeight;
                            }
                            if (document.body) h2 = document.body.scrollHeight;
                            var h = Math.max(h1, h2);
                            if (window.ActiveXObject) { h += 4; }
                            else { h += 4; }
                            a[i].style.height = h + "px";
                            window.removeEventListener('resize', iframeAutoFit, false); //兼容谷歌浏览器时要去掉RISZE监听
                        }
                    }
                }
            }
            catch (ex) { }
        }
    </script>
</head>
<body>
@using (Html.BeginForm("ExportToExcel", "DocInfoOrder", FormMethod.Post, new { id = "form1" }))
{
    @*<div class="floatToolMenu" id="toolMenu">
        @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnExport";
               item.Text = "导出Excel";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");

           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
    </div>*@
    <div>
    <table border="0" cellpadding="0" cellspacing="0"  style="height:40px;" align="center">
        <tr>
            <td style="font-size:9pt; text-align:right" >&nbsp;&nbsp;&nbsp;&nbsp;年度:</td>
            <td>
                @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FYear";
                            settings.Width = 80;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                        }).BindList(ViewData["FYearSelection"]).Bind(ViewData["FYearSelected"]).GetHtml()
            </td>
            <td style="font-size:9pt;text-align:right">&nbsp;&nbsp;&nbsp;&nbsp;季度:</td>
            <td>
                @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FQuarter";
                            settings.Width = 100;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                        }).BindList(ViewData["quarterSelection"]).Bind(ViewData["quarterSelected"]).GetHtml()
            </td>
            <td>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                @Html.DevExpress().Button(settings =>
                {
                    settings.Name = "btnSearch";
                    settings.Text = "查询";
                    settings.ControlStyle.CssClass = "button";
                    settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                    settings.ClientSideEvents.Click = "search";
                }).GetHtml()
                
            </td>
            <td>
            &nbsp;&nbsp;&nbsp;
            </td>
            <td>
             @Html.DevExpress().Button(settings =>
                {
                    settings.Name = "btnExportExcel";
                    settings.Text = "导出EXCEL";
                    settings.ControlStyle.CssClass = "button";
                    settings.Images.Image.Url = Url.Content("~/Content/ControlImages/excel.png");
                    settings.ClientSideEvents.Click = "ExportToExcel";
                }).GetHtml()
            </td>
        </tr>
    </table>
    <table id="tbDocInfoOrder" border="0" cellpadding="0" cellspacing="0" width="99%" class="table" >
    
    </table>
    </div>
    
    @Html.Hidden("hidDocInfoOrder", ViewData["tbDocInfoOrder"])
    @Html.Hidden("hidFYear")
    @Html.Hidden("hidFQuarter")
    @Html.Hidden("hidIntLocalCount", ViewData["intLocalCount"])
    @Html.Hidden("hidIntChkCount", ViewData["intChkCount"])
}
</body>
</html>
